{{>licenseInfo}}
package {{invokerPackage}}
import {{apiPackage}}._
import {{invokerPackage}}.app.{ ResourcesApp, OpenAPIApp }
import javax.servlet.ServletContext
import org.scalatra.LifeCycle

class ScalatraBootstrap extends LifeCycle {
  implicit val openapi = new OpenAPIApp

  override def init(context: ServletContext) {
    try {
      {{#apiInfo}}
      {{#apis}}
      context mount (new {{classname}}, "{{basePathWithoutHost}}/{{baseName}}/*")
      {{/apis}}
      {{/apiInfo}}
      context mount (new ResourcesApp, "/api-docs/*")
    } catch {
      case e: Throwable => e.printStackTrace()
    }
  }
}
